﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ARS.Control.Custom.Entity.Fields;

namespace NetWebControl.ControlTest.OA
{
    class Test
    {
        public Test()
        { }
        #region Model
        private int _users_roles_id;
        private int? _parentid;
        private string _name;
        private DateTime? _addtime;
        private string _remark;
        private int? _company_info_id;
        /// <summary>
        /// 角色ID
        /// </summary>
        [KeyField()]
        public int Users_Roles_Id
        {
            set { _users_roles_id = value; }
            get { return _users_roles_id; }
        }
        /// <summary>
        /// 父级角色ID
        /// </summary>
        public int? ParentId
        {
            set { _parentid = value; }
            get { return _parentid; }
        }
        /// <summary>
        /// 角色名字
        /// </summary>
        [CharField(Verbose_Name = "角色名字")]
        public string Name
        {
            set { _name = value; }
            get { return _name; }
        }
        /// <summary>
        /// 创建时间
        /// </summary>
        [DateTimeAutoField(Auto_Now_Add = true)]
        public DateTime? AddTime
        {
            set { _addtime = value; }
            get { return _addtime; }
        }
        /// <summary>
        /// 角色说明
        /// </summary>
        [IntegerField(Verbose_Name = "说明")]
        public string Remark
        {
            set { _remark = value; }
            get { return _remark; }
        }
        /// <summary>
        /// 公司ID
        /// </summary>
        [UserField()]
        public int? Company_Info_Id
        {
            set { _company_info_id = value; }
            get { return _company_info_id; }
        }
        #endregion Model

    }

    public partial class entityList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Users_Roles role = new Users_Roles();
            this.EntityModifyList1.RequestKey = "Id";
            this.EntityModifyList1.Entity = role;
            this.EntityModifyList1.Number = 3;
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            this.EntityModifyList1.AddOrUpdateEntityToDb();
        }
    }
}